﻿using FluentValidation;
using Jupiter.Infrastructure.Domain;
using MediatR;

namespace Wips.AppService.Authorities.Organizations.Requests
{
    /// <summary>
    /// 
    /// </summary>
    public class UpdateOrganizationExtendRequest : IRequest<string>, ITxRequest
    {
        /// <summary>
        /// 
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// 联系人姓名
        /// </summary>
        public string ContactName { get; set; }

        /// <summary>
        /// 联系人手机号
        /// </summary>
        public string ContactPhoneNumber { get; set; }

        /// <summary>
        /// 经度
        /// </summary>
        public string Longitude { get; set; }

        /// <summary>
        /// 纬度
        /// </summary>
        public string Latitude { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get; set; }



        /// <summary>
        /// 扩展备注
        /// </summary>
        public string ExtendRemarks { get; set; }
    }

    /// <summary>
    /// 
    /// </summary>
    public class UpdateOrganizationExtendValidator : AbstractValidator<UpdateOrganizationExtendRequest>
    {
        /// <summary>
        /// 
        /// </summary>
        public UpdateOrganizationExtendValidator()
        {
            RuleFor(p => p.Id)
                .Must(p => !string.IsNullOrEmpty(p))
                .WithMessage("Id不能为空");
            //RuleFor(p => p.ContactName)
            //    .Must(p => !string.IsNullOrEmpty(p))
            //    .WithMessage("联系人不能为空")
            //    .MaximumLength(8)
            //    .WithMessage("联系人姓名最大支持8个字");
            //RuleFor(p => p.ContactPhoneNumber)
            //    .Must(p => !string.IsNullOrEmpty(p))
            //    .WithMessage("手机号不能为空")
            //    .MaximumLength(11)
            //    .WithMessage("手机号长度只能为11位");
        }
    }
}